package com.pan.kang.demo.decoratorService;


import com.pan.kang.core.BaseDecoratorInterface;
import com.pan.kang.core.Decorator;
import com.pan.kang.core.Flow;
import com.pan.kang.demo.decoratorService.impl.UserDecoratorService;
import com.pan.kang.demo.service.GoodsService;
import com.pan.kang.demo.service.UserService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;

/**
 * UserDecoratorServiceImpl 对 UserService 进行装饰和增强
 */
@Decorator
@Slf4j
public class UserDecoratorServiceImpl extends BaseDecoratorInterface<UserService> implements UserDecoratorService {

    public UserDecoratorServiceImpl(UserService userService) {
        super(userService);
    }

    @Autowired
    private GoodsService goodsService;

    @Override
    @Flow(step = Flow.Step.history)
    public void applyCallback() {
        getService().apply();
        goodsService.audit();
        log.info("用户审核通过...");
    }

    @Override
    public void history() {
        log.info("历史记录...");
    }
}
